﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BDS3M.Controls
{
    public partial class BoxChiTietMail : System.Web.UI.UserControl
    {
        public string subject;
        public string sendto;
        public string sendfrom;
        public string content;

        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                DataTable dt = DAL.DCollector.DBCollector.Instance.StoredSelectAllTableWhereID("tbl_Message", "Message_ID", Request.QueryString["ID"].ToString());                

                subject = dt.Rows[0]["Message_Subject"].ToString();
                sendto = dt.Rows[0]["Message_To"].ToString();
                sendfrom = dt.Rows[0]["Message_From"].ToString();
                content = Server.HtmlDecode(dt.Rows[0]["Message_Content"].ToString());

            }
        }
        public string getUserfromID(string id)
        {
            return DAL.DCollector.DBCollector.Instance.StoredSelectAllTableWhereID("tbl_Employee", "Employee_ID", id).Rows[0]["Employee_User"].ToString();
        }


    }
}